#include <stdlib.h>
#include <stdio.h>
#include <dlfcn.h>


extern int a[1024*30];
extern int b;
int main(int argc, char argv[]) {  
	
    printf("==========================\n");
	void *handle;
	void (*pfunc)();
	handle = dlopen( "liba.so", RTLD_LAZY );
	pfunc = (void (*)())dlsym(handle,"al");
	(*pfunc)();
    printf("==========================\n");
	

    printf("==========================\n");
    printf("In main -- main data section --- extern int b : %08p\n", &b);
    printf("In main --  heap -- extern int a[1024*30] : %08p\n", a);
	
	int i= 0;
	for(;i<10;i++)
	{
		a[i] = 100;
		printf("%d\n",a[i]);
	}
    printf("==========================\n");
	
	sleep(100000);
	return 0;  
} 
